package com.jt.friendsmanagement;

import java.util.Calendar;
import java.util.Date;
import java.util.UUID;

/*朋友类：
 * properties：UUID 姓名 性别 生日 爱好*/
public class Friend {
    private UUID mId;
    private String mName;
    private Date mBirthday;
    private String mSex;
    private int mAge;
    private String mConstellation;
    private String[] mHobbies = {"", "", ""}; //兴趣 数组    /*可以用list*/


    public String[] getHobbies() {
        return mHobbies;
    }

    public void setHobbies(String[] hobbies) {
        mHobbies = hobbies;
    }


    public Friend() {
        mId = UUID.randomUUID();
        mBirthday = new Date();
    }

    public UUID getId() {
        return mId;
    }

    public void setId(UUID id) {
        mId = id;
    }

    public String getName() {
        return mName;
    }

    public void setName(String name) {
        mName = name;
    }

    public Date getBirthday() {
        return mBirthday;
    }

    public void setBirthday(Date birthday) {
        /*要设置生日、年龄、星座*/
        mBirthday = birthday;
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        int year = calendar.get(Calendar.YEAR);
        calendar.setTime(birthday);
        mAge = year - calendar.get(Calendar.YEAR);
        mConstellation = FriendsListFragment.getConstellation(FriendsListFragment.constellationArr, calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));

    }

    public String getSex() {
        return mSex;
    }

    public void setSex(String sex) {
        mSex = sex;
    }
}
